fn main() {
    println!("Hello, world!");

    another_function(5);

    print_labeled_measurement(6, 'h');

    // 注意，x + 1 行的末尾没有分号，这与你目前见过的大部分代码行不同。表达式的结尾没有分号。如果在表达式的末尾加上分号，那么它就转换为语句，而语句不会返回值。
    let y = {
        let x = 3;
        x + 1
    };

    println!("The value of y is: {}", y); // 4

    println!("invoked function five, return value: {}", five());

    let x = plus_one(5);

    println!("The value of x is: {}", x);
}


fn another_function(x: i32) {
    println!("The value of x is: {}", x);
}

fn print_labeled_measurement(value: i32, unit_label: char) {
    println!("The measurement is: {}{}", value, unit_label);
}

fn five() -> i32 {
    5
}

fn plus_one(x: i32) -> i32 {
    x + 1
}x